import { axios } from '@/utils/request'
export function studentList(params) {
  return axios({
    url: '/school/students',
    method: 'post',
    data: params
  })
}
export function studentCreate(params) {
  return axios({
    url: '/school/students/create',
    method: 'post',
    data: params
  })
}
export function studentexport(params) {
  return axios({
    url: '/school/students/download-potential-stu-template',
    method: 'post',
    data: params,
    // responseType: 'blob'
  })
}
export function studentdownload(params) {
  return axios({
    url: '/school/students/download-stu-template',
    method: 'post',
    data: params,
    // responseType: 'blob'
  })
}
export function studentInfo(params) {
  return axios({
    url: '/school/students/' + params,
    method: 'post',
  })
}

export function studentDel(params) {
  return axios({
    url: '/school/students/' + params + '/delete',
    method: 'post',
  })
}

export function studentEdit(params, id) {
  return axios({
    url: '/school/students/' + id + '/update',
    method: 'post',
    data: params
  })
}

//学生调整/移出班级  //移出班级不传to_class_id
export function studentChangeClass(params) {
  return axios({
    url: '/school/students/change-class',
    method: 'post',
    data: params
  })
}

export function studentAddList(params, id) { //id——班级id
  return axios({
    url: '/school/classes/' + id + '/not-in-students',
    method: 'post',
    data: params
  })
}
export function studentAllotClass(params, id) {  //学员分配班级  id——班级id
  return axios({
    url: '/school/classes/' + id + '/add-students',
    method: 'post',
    data: params
  })
}
export function studentToHistory(id) {  //学员转历史学院
  return axios({
    url: '/school/students/' + id + '/to-history-student',
    method: 'post',
  })
}

export function sendMsg(params) {  //发消息
  return axios({
    url: '/school/notices/create',
    method: 'post',
    data: params
  })
}

export function signUp(params) {  //报名
  return axios({
    url: '/school/students/registration-renewals',
    method: 'post',
    data: params
  })
}


// 学生详情选项卡
export function studentFollow(params) {  //跟进记录列表
  return axios({
    url: '/school/follow',
    method: 'post',
    data: params
  })
}

export function studentFollowDel(id) {  //del记录列表
  return axios({
    url: '/school/follow/' + id + '/delete',
    method: 'post',
  })
}
export function studentFollowAdd(params) {  //add跟进记录
  return axios({
    url: '/school/follow/create',
    method: 'post',
    data: params
  })
}

export function studentFollowInfo(params) {  //info跟进记录
  return axios({
    url: '/school/follow/' + params,
    method: 'post',
  })
}

export function studentFollowEdit(params, id) {  //edit跟进记录
  return axios({
    url: '/school/follow/' + id + '/update',
    method: 'post',
    data: params
  })
}


export function takeClassAlready(params) {  //上课记录
  return axios({
    url: '/school/call-records/stu_record',
    method: 'post',
    data: params
  })
}

export function takeClassNotYet(params) {  //待上课记录
  return axios({
    url: '/school/call-records/for_class',
    method: 'post',
    data: params
  })
}

// 学生上课记录导出
export function takeClassExcel(params) {
  let str = '?'
  if (params.student_id) {
    str = str + '&student_id=' + params.student_id
  }
  if (params.teacher_id) {
    str = str + '&teacher_id=' + params.teacher_id
  }
  if (params.start_time) {
    str = str + '&start_time=' + params.start_time
  }
  if (params.end_time) {
    str = str + '&end_time=' + params.end_time
  }
  if (params.course_id) {
    str = str + '&course_id=' + params.course_id
  }
  if (params.class_id) {
    str = str + '&class_id=' + params.class_id
  }
  if (params.school_id) {
    str = str + '&school_id=' + params.school_id
  }
  return axios({
    url: '/school/call-records/export' + str,
    method: 'get',
    // responseType: 'blob'
  })
}

export function getScoreList(params) {  //成绩单
  return axios({
    url: '/school/exams',
    method: 'post',
    data: params
  })
}
export function temporaryStudent(params, id) {  //临时学员列表
  return axios({
    url: '/school/classes/' + id + '/temporary-student',
    method: 'post',
    data: params
  })
}
export function studentOrderList(params) {
  return axios({
    url: '/school/consume',
    method: 'post',
    data: params
  })
}

export function excelIn(params) {  //导入学员
  return axios({
    url: '/school/students/import',
    method: 'post',
    data: params
  })
}


export function qianzaiStudentExcelIn(params) {  //导入潜在学员
  return axios({
    url: '/school/students/potential-import',
    method: 'post',
    data: params
  })
}

export function qianzaiStudentBatchDel(params) {  //批量删除潜在学员
  return axios({
    url: '/school/students/batch-delete',
    method: 'post',
    data: params
  })
}

export function ruleStudent(params) {  //报名验证学员是否相同
  return axios({
    url: '/school/students/same-student',
    method: 'post',
    data: params
  })
}
//报读课程

export function readCourse(id){
  return axios({
    url:'school/students/'+id+'/register-course',
    method: 'post',
  })
}
//报读课程 课时清零
export function clearClassHour(id,params){
  return axios({
    url:'school/students/'+id+'/class-hour-clearing',
    method: 'post',
    data:params
  })
}
//无需补扣
export function noMakeUp(id){
  return axios({
    url:`school/call-records/${id}/no-make-up`,
    method: 'post',
  })
}
export function makeUp(id){
  return axios({
    url:`school/call-records/${id}/make-up`,
    method: 'post',
  })
}
export function isAdequate(id){
  return axios({
    url:`school/call-records/${id}/is-adequate`,
    method: 'post',
  })
}
//不在提醒

export function noRemind(id){
  return axios({
    url:`school/call-records/${id}/no-remind`,
    method: 'post',
  })
}
export function studentEndCourse(id,params){
  return axios({
    url:`school/students/${id}/end-course`,
    method: 'post',
    data:params
   
  })
}
//结课记录

export function endingList(id,params){
  return axios({
    url:`school/students/${id}/class-ending-list`,
    method: 'post',
    data:params
  })
}
//撤销
export function revokeEndCourse(id,params){
  return axios({
    url:`school/students/${id}/revoke-end-course`,
    method: 'post',
    data:params
  })
}
//设置起始日
export function checkDateStatus(params){
  return axios({
    url:`school/orders/set-date-status`,
    method: 'post',
    data:params
  })
}
//设置课时有效期
export function setHourTime(params,id){
  return axios({
    url:`school/orders/${id}/set-hour-due-time`,
    method: 'post',
    data:params
  })
}
export function setStartEndDate(params){
  return axios({
    url:`school/orders/set-start-end-date`,
    method: 'post',
    data:params
  })
}
//报读情况
export function signUpList(params){
  return axios({
    url:`school/sign-up-infos`,
    method: 'post',
    data:params
  })
}
//下载课时导入模板
export function downloadClassHourImport(params){
  return axios({
    url:`school/sign-up-infos/download-ks-template`,
    method: 'post',
    data:params
  })
}
//下载按天导入模板
export function downloadClassDayImport(params){
  return axios({
    url:`school/sign-up-infos/download-class-time-template`,
    method: 'post',
    data:params
  })
}
export function classHourImport(params){
  return axios({
    url:`school/sign-up-infos/class-hour-import`,
    method: 'post',
    data:params
  })
}
export function classDayImport(params){
  return axios({
    url:`school/sign-up-infos/class-time-import`,
    method: 'post',
    data:params
  })
}
//报读统计
export function enrollStatistics(params){
  return axios({
    url:`school/sign-up-infos/statistics`,
    method: 'post',
    data:params
  })
}
//批量结课
export function batchEndClass(params){
  return axios({
    url:`school/sign-up-infos/batch-end-class`,
    method: 'post',
    data:params
  })
}
//剩余课时列表
export function surplusHour(params){
  return axios({
    url:`school/sign-up-infos/order-list`,
    method: 'post',
    data:params
  })
}
//批量修正课时

export function correctClassHour(params){
  return axios({
    url:`school/sign-up-infos/correct-surplus-ks`,
    method: 'post',
    data:params
  })
}
//批量课时清零

export function batchClassHourClearing(params){
  return axios({
    url:`school/sign-up-infos/batch-class-hour-clearing`,
    method: 'post',
    data:params
  })
}
//报读导出
export function reportExport(params){
  return axios({
    url:`school/sign-up-infos/export`,
    method: 'get',
    params:params
  })
}
//解绑考勤卡
export function unbundling(id){
  return axios({
    url:`/school/students/${id}/unbind-attend-card`,
    method: 'post',
  })
}
//增加卡号
export function addIdCard(id,params){
  return axios({
    url:`/school/students/${id}/bind-attend-card`,
    data: params,
    method:'post'
  })
}
//导出学生列表
export function studentExport(data){
  return axios({
    url:`/school/students/export`,
    params: data,
    method:'get',
  })
}